<template>
<div class="hisbox">
    <van-cell title="历史记录" >
        <!-- <span><span>全部删除</span>  <span>已完成</span></p> -->
        <van-icon size="mini"  name="delete" @click='delallhis'></van-icon>
    </van-cell>
    <van-cell v-for="(item,index) in hislist" :key="index" :title="item" @click="getsearch(item)"><van-icon size="mini"  name="close" @click.stop="delthishis(index)"></van-icon></van-cell>
</div>
</template>

<script>
import {getItem,setItem} from '@/utils/localfun'
export default {
  components: {},
  props: {},
  data() {
   return {}
  },
  watch: {},
  computed: {
    hislist:function(){
      return this.$store.state.hislist
    }
  },
  methods: {
    delallhis(){
      this.$store.commit('delallhistory')
      this.$toast('删除成功')
    },
    delthishis(index){
      this.$store.commit('delthehistory',index)
      this.$toast('删除成功')
    },
    getsearch(item){
      this.$emit('getsearch',{q:item})
    }
  },
  created() {
    
  },
  mounted() {}
};
</script>
<style lang="less" scoped>
</style>